-
Notifications
You must be signed in to change notification settings - Fork 381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(gnolang): fix panic when using struct as index of map #2044
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2044 +/- ##
==========================================
- Coverage 54.96% 54.96% -0.01%
==========================================
Files 481 481
Lines 67391 67390 -1
==========================================
- Hits 37043 37040 -3
Misses 27329 27329
- Partials 3019 3021 +2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @omarsy 🎉. This looks like the right place for the fix. Is it necessary to declare the new bzl
slice or could this be solved by referencing field's type directly?
Thank you for your review @deelawn bz = append(bz, '{')
for i := 0; i < sl; i++ {
fv := fillValueTV(store, &sv.Fields[i])
omitTypes := FieldTypeList(bt.Fields).Types()[i].Kind() != InterfaceKind
bz = append(bz, fv.ComputeMapKey(store, omitTypes)...)
if i != sl-1 {
bz = append(bz, ',')
}
} I use a variable for optimisation stuff, |
Would it be the same as using |
My mistake, it's actually the same, no need for a new variable. Your suggestion is better. |
Closes #2041. Use fieldlist to get field type
Contributors' checklist...
BREAKING CHANGE: xxx
message was included in the description